package com.petecat.interchan;

import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import com.petecat.interchan.auth.common.AuthFilter;

/**
 * 
 * @ClassName:  MyFilter   
 * @Description:过滤器
 * @author: mhuang
 * @date:   2017年10月27日 下午3:21:39
 */
@Component
public class MyFilter {

	@Bean
	 public FilterRegistrationBean filterRegistrationBean() {
	      FilterRegistrationBean registrationBean = new FilterRegistrationBean();
	      AuthFilter actionFilter = new AuthFilter();
	      registrationBean.setFilter(actionFilter);
	      List<String> urlPatterns = new ArrayList<>();
	      urlPatterns.add("/base/*");
	      registrationBean.setUrlPatterns(urlPatterns);
	      return registrationBean;
	    }
}
